using Cooking.Core.Model;

namespace Cooking.Web.ViewData
{
    public class EditRecipeViewData
    {
        public Recipe Recipe { get; set; }
        public int EditIngredientId { get; set; }
        public int EditStepId { get; set; }

        public bool AllowAddIngredients()
        {
            return !string.IsNullOrEmpty(Recipe.Name) && EditIngredientId <= 0 && EditStepId <= 0;
        }

        public bool AllowAddSteps()
        {
            return Recipe != null &&
                   Recipe.Ingredients.Count > 0 &&
                   EditIngredientId <= 0 &&
                   EditStepId <= 0;
        }
    }
}